<HTML><HEAD><TITLE>events_after(++Events)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Event Handling</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>events_after(++Events)</H1>
   Set up a series of after events Events. 


<DL>
<DT><EM>Events</EM></DT>
<DD>A list of the form Event-Time or Event-every(Time)
</DD>
</DL>
<H2>Description</H2>
   Events is a list of after events where each element of the list
   specifies one after event. Each element is either in the form of
   EventName-Time or EventName-every(Time) where the first form is
   equivalent to event_after(EventName, Time) and the second to
   event_after_every(EventName, Time). The difference between using
   a single events_after/1 and multiple calls to event_after/2, 
   event_after/3 and event_after_every/2 to set up a series of after 
   events is that with events_after/1, all the events are set up as a 
   unit, and it is guaranteed that the relative orderings between the 
   events are preserved, and that no after events will be raised until
   all the specified events have been set up.
<P>
   The main use of events_after/1 is for restart event that have been
   cancelled previously with cancel_after_event/2.
<P>
   See event_after/2, event_after/3 or event_after_every/2 for more details
   on after events.

<H3>Modes and Determinism</H3><UL>
<LI>events_after(++) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Events is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Events is not a list of after events of the form Event-Time or Event-every(Time), where Event is an atom or a handle and Time is a positive (non-breal) number.
</DL>
<H2>Examples</H2>
<PRE>
    % set event handlers to write the event name
    ?- set_event_handler(e1, writeln/1),
    	set_event_handler(e2, writeln/1).
    Yes (0.00s cpu)

    ?- events_after([e1-every(0.2), e2-0.5]),
    	repeat,fail.
    e1
    e1
    e2
    e1
    e1
    e1
    ^C
    interruption: type a, b, c, e, or h for help : ? a
    abort
    Aborting execution ...
    Abort

    % cancel further e1 events
    ?- cancel_after_event(e1, Cancelled).
    Cancelled = [e1 - every(0.2)]
    Yes (0.00s cpu)

    % e2 was already raised, nothing to cancel
    ?- cancel_after_event(e2, Cancelled).
    Cancelled = []
    Yes (0.00s cpu)

    % restart the cancelled events
    ?- events_after([e1 - every(0.2)]),
	    repeat, fail.
    e1
    e1
    e1
    e1
    ...
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/event/event_after-2.html">event_after / 2</A>, <A HREF="../../kernel/event/event_after-3.html">event_after / 3</A>, <A HREF="../../kernel/event/event_after_every-2.html">event_after_every / 2</A>, <A HREF="../../kernel/event/cancel_after_event-2.html">cancel_after_event / 2</A>, <A HREF="../../kernel/event/events_after-1.html">events_after / 1</A>, <A HREF="../../kernel/event/event-1.html">event / 1</A>, <A HREF="../../kernel/event/set_event_handler-2.html">set_event_handler / 2</A>, <A HREF="../../kernel/event/current_after_events-1.html">current_after_events / 1</A>, <A HREF="../../kernel/event/event_create-3.html">event_create / 3</A>, <A HREF="../../kernel/event/event_retrieve-3.html">event_retrieve / 3</A>, <A HREF="../../kernel/env/get_flag-2.html">get_flag / 2</A>
</BODY></HTML>
